/*
 * @Author: Dorange.Wang
 * @Date: 2021-03-31 16:03:05
 * @LastEditors: your name
 * @LastEditTime: 2021-04-06 17:53:26
 * @Description: file content
 */
import Vue from 'vue'
import template from './template'
class CreateInstance {
  constructor () {
    this.instance = null
  }
  static create () {
    if (!this.instance) {
      const BenConstructor = Vue.extend(template)
      this.instance = new BenConstructor({
        el: document.createElement('div')
      })
      document.body.appendChild(this.instance.$el)
    }
  }
  static addForm (...arg) {
    this.create()
    return this.instance.addForm(...arg)
  }
  static editForm (...arg) {
    this.create()
    return this.instance.editForm(...arg)
  }
  static copyForm (...arg) {
    this.create()
    return this.instance.copyForm(...arg)
  }
  static verForm (...arg) {
    this.create()
    return this.instance.verForm(...arg)
  }
  static descForm (...arg) {
    this.create()
    return this.instance.descForm(...arg)
  }
}
export default CreateInstance
